import _regeneratorRuntime from "@babel/runtime/regenerator";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
var _excluded = ["tenantId"];

/**
 * tenantManagerService.js - 租户管理员 service
 * @date: 2019-01-10
 */
import request from 'utils/request';
import { CPAAS_PLATFORM } from 'utils/config';
import { parseParameters } from 'utils/utils';
var prefix = "".concat(CPAAS_PLATFORM, "/v1");
/**
 * 登录记录查询
 * @export
 * @param {*} params
 * @returns
 */

export function fetchRecords(_x) {
  return _fetchRecords.apply(this, arguments);
}

function _fetchRecords() {
  _fetchRecords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
    var tenantId, params, param;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            tenantId = _ref.tenantId, params = _objectWithoutProperties(_ref, _excluded);
            param = parseParameters(params);
            return _context.abrupt("return", request("".concat(prefix, "/audit-logins/self"), {
              method: 'GET',
              query: param
            }));

          case 3:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));
  return _fetchRecords.apply(this, arguments);
}